package com.yubest.device;

import com.google.gson.Gson;
import com.yubest.device.util.*;

import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

public class MainApp {

    public static void main(String[] args) {
        try {
            DeviceInfo deviceInfo = DeviceUtil.getDeviceInfo();
            String json = new Gson().toJson(deviceInfo);
            Files.write(Paths.get("device.json"), json.getBytes(StandardCharsets.UTF_8));
            System.out.println("success");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
